a11y: don't shutdown accessibility, so the atk bridge is always valid
authorMario Sanchez Prada <mario.prada@samsung.com>
Mon, 16 Sep 2013 15:57:49 +0000 (16:57 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 26 Sep 2013 00:14:04 +0000 (20:14 -0400)
This will fix issues in applications that for some reason make
several and not nested calls to gtk_main() during their lifetime,
effectively initializing a11y when the first, top most, main loop
is being run and shutting it down then that loop is quit.

https://bugzilla.gnome.org/show_bug.cgi?id=708024

https://bugzilla.gnome.org/show_bug.cgi?id=684076

gtk/a11y/gtkaccessibility.c
gtk/a11y/gtkaccessibility.h
gtk/gtkapplication.c
gtk/gtkmain.c

index 407ffe73fe5ca69e32a4a5ea497cac2da8406e9e..3c51f26508eb5c303227c15801abf75d6a10ae9f 100644 (file)
@@ -967,35 +967,6 @@ do_window_event_initialization (void)
   g_signal_connect (root, "children-changed::remove", (GCallback) window_removed, NULL);
 }
 
-static void
-undo_window_event_initialization (void)
-{
-  AtkObject *root;
-
-  root = atk_get_root ();
-
-  g_signal_handlers_disconnect_by_func (root, (GCallback) window_added, NULL);
-  g_signal_handlers_disconnect_by_func (root, (GCallback) window_removed, NULL);
-}
-
-
-void
-_gtk_accessibility_shutdown (void)
-{
-  if (!initialized)
-    return;
-
-  initialized = FALSE;
-
-  g_clear_object (&atk_misc_instance);
-
-#ifdef GDK_WINDOWING_X11
-  atk_bridge_adaptor_cleanup ();
-#endif
-
-  undo_window_event_initialization ();
-}
-
 void
 _gtk_accessibility_init (void)
 {
index 461e219a895cc0eb4158e8e01962683c99f6c783..c3df055dec2861420f5702f633bddc4c7855c649 100644 (file)
@@ -23,7 +23,6 @@
 
 G_BEGIN_DECLS
 
-void      _gtk_accessibility_shutdown    (void);
 void      _gtk_accessibility_init        (void);
 
 gboolean  _gtk_accessibility_key_snooper (GtkWidget   *widget,
index 0da7bfc9aee28d7ea2e5fbe5a32d2152772ae99d..dfd6924c795cecdea1024cef19259557a2e8e08f 100644 (file)
@@ -47,8 +47,6 @@
 #include <gdk/x11/gdkx.h>
 #endif
 
-extern void _gtk_accessibility_shutdown (void);
-
 /**
  * SECTION:gtkapplication
  * @title: GtkApplication
@@ -433,8 +431,6 @@ gtk_application_shutdown (GApplication *application)
   /* Synchronize the recent manager singleton */
   _gtk_recent_manager_sync ();
 
-  _gtk_accessibility_shutdown ();
-
   G_APPLICATION_CLASS (gtk_application_parent_class)
     ->shutdown (application);
 }
index 285d181a73fcfb4a16267be473294b2adcca70e2..eba38ccf4e462a715b12b2a089ecde93a8138f32 100644 (file)
@@ -1175,8 +1175,6 @@ gtk_main (void)
 
       /* Synchronize the recent manager singleton */
       _gtk_recent_manager_sync ();
-
-      _gtk_accessibility_shutdown ();
     }
 }